﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!-- 引入标签库 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib prefix="s" uri="/struts-tags"%> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主题详情</title>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
            font-size: 14px;
            line-height: 1.42857143;
            background-color: #d5fffd;
        }
        .navcolor{
            background-color: #c5eaff;
        }
        [class*="col-"] {
            padding-top: 15px;
            padding-bottom: 15px;
            background-color: #eee;
            background-color: rgba(86,61,124,.15);
            border: 1px solid #ddd;
            border: 1px solid rgba(86,61,124,.2);
        }

    </style>
</head>
<body>
<br>
<br>
<br>
<nav class="navbar navcolor navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <a class="navbar-brand" href="main.html">VoteSys投票系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="messagelist.html">主页</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <br>
                <li>用户：？？？您好</li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>
<div class="container">
    <h1>
        主题详情
    </h1>
    <div class="row">
        <div class="col-md-6">
       <form action="<s:property value="#request.returnAction"/>" id="topicform" enctype="multipart/form-data" method="post">
       		<input type="hidden" name="topicid" id="topicid" value="<s:property value="#request.VoteTopic.topicId"/>">
            <h3>主题名称</h3>
            <h4><input type="text" value="<s:property value="#request.VoteTopic.topicName"/>" id="topicname" name="topicname"></h4>
            <h3>主题描述</h3>
            <textarea class="form-control" rows="11" id="topicdescription" name="topicdescription"><s:property value="#request.VoteTopic.topicDescription"/></textarea>
             <h3>logo名称</h3>
            <h4><input type="text" value="<s:property value="#request.VoteTopic.logoName"/>" id="logoname" name="logoname"></h4>
            <h3>logo</h3>
            <input type="file" id="logo" name="logo" value="<s:property value="#request.VoteTopic.logo"/>">
            <h3>展示方式</h3>
            <input type="number" id="showpattern" name="showpattern" value="<s:property value="#request.VoteTopic.showPattern"/>">
            <%-- <select class="form-control" id="showpattern" name="showpattern" value="<s:property value="#request.VoteTopic.showPattern"/>">
                <option>0</option>
                <option>1</option>
                <option>2</option>
            </select> --%>
            <h3>是否检查</h3>
            <input type="number" id="checkout" name="checkout" value="<s:property value="#request.VoteTopic.checkOut"/>">
            <%-- <select class="form-control" id="checkout" name="checkout" value="<s:property value="#request.VoteTopic.checkOut"/>">
                <option>0</option>
                <option>1</option>
            </select> --%>
            <tr>
                <td>
                    <h3>投票数</h3>
                    最少:<input type="number" id="mincount" name="mincount" value="<s:property value="#request.VoteTopic.minCount"/>">最大<input type="number" id="maxcount" name="maxcount" value="<s:property value="#request.VoteTopic.maxCount"/>">
                    <h3>是否展示</h3>
                </td>
            </tr>
            <tr>
                <td>
                <input type="number" id="flag" name="flag" value="<s:property value="#request.VoteTopic.flag"/>">
	                <%-- <select calss="form control" id="flag" name="flag" value="<s:property value="#request.VoteTopic.flag"/>">
	                	<option>0</option>
	                	<option>1</option>
	                </select> --%>
                </td>
            </tr>
            <br>
            <br>
            <tr>
                <td>
                    <input type="submit" value="提交"><button class="btn btn-info">确定</button>
                </td>
            </tr>
       </form>

            <h2>内容列表</h2>
            <div class="table table-striped">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>内容名称</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <s:iterator value="#request.VoteContentList" status="statu">
                    <tbody>
                        <tr>
                            <td><s:property value="contentName"/></td>
                            <td><a href="ShowContent?contentid=<s:property value="contentId"/>"><input type="button" value="修改"></a><input type="button" value="删除"></td>
                        </tr>
                    </tbody>
                    </s:iterator>
                    <tr>
                        <td>
                            <a href="NewContent?topicid=<s:property value="topicid"/>"><button class="btn btn-info">新增内容</button></a>
                        </td>
                    </tr>
            </table>
        </div>
        <br>
    </div>
    <br>
</div>
</div> <!-- /container -->
<script language="javascript">
obj = document.getElementById(checkout);
for(i=0;i<obj.length;i++){
  if(obj[i].value == "<s:property value="#request.VoteTopic.checkOut"/>")
    obj[i].selected = true;
}
</script>
<script src="bootstrap/jquery-1.9.1.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="bootstrap/less/navbar.less"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
